package com.hnucm.onlinealgstudy.service;

import com.hnucm.onlinealgstudy.dao.UserMapper;
import com.hnucm.onlinealgstudy.pojo.Approval;
import com.hnucm.onlinealgstudy.pojo.User;
import com.hnucm.onlinealgstudy.pojo.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
@Service
public class UserServiceImpl implements UserService{
    @Autowired
    UserMapper userMapper;
    @Override
    public List<User> getUserList(User user) {
        return userMapper.getUserList(user);
    }

    @Override
    public List<User> getAllUserList(String user_name, Timestamp start_time, Timestamp end_time) {
        return userMapper.getAllUserList(user_name, start_time, end_time);
    }

    @Override
    public List<User> findUserById(Integer id) {
        return userMapper.findUserById(id);
    }

    @Override
    public List<User> findUserByName(String user_name) {
        return userMapper.findUserByName(user_name);
    }


    @Override
    public void addUser(User user) {
        userMapper.addUser(user);
    }

    @Override
    public void postUpdateInfo(UserInfo userInfo) {
        userMapper.postUpdateInfo(userInfo);
    }

    @Override
    public List<UserInfo> getUpdateInfo() {
        return userMapper.getUpdateInfo();
    }

    @Override
    public void approvalUpdateInfo(Approval approval) {
        userMapper.approvalUpdateInfo(approval);
    }

    @Override
    public void updateUser(User user) {
        userMapper.updateUser(user);
    }

    @Override
    public void deleteUser(Integer id) {
        userMapper.deleteUser(id);
    }

    @Override
    public void addCorrectNum(String user_name) {
        userMapper.addCorrectNum(user_name);
    }

    @Override
    public void addWrongNum(String user_name) {
        userMapper.addWrongNum(user_name);
    }
}
